﻿#pragma once
#include <QtWidgets/QMainWindow>
#include <qthread.h>


#include <QtSql/qsqldatabase.h> //sql驱动基础
#include <QtSql/QSqlQuery>//sql查询相关
#include <QtSql/QSqlError>//sql输出错误

class QLabel;
class QPushButton;
class QThread;
class QTextBrowser;
class QListWidget;
class QLineEdit;

class xray_predict_mainwindow : public QMainWindow
{
    Q_OBJECT
    QThread predictThread;
    QThread uploadThread;

public:
    xray_predict_mainwindow(QWidget* parent = Q_NULLPTR);
    ~xray_predict_mainwindow();
    void setUi();
    void initconnection();
    QString currentId;

private slots:
    void browseXRaySlot();
    void predictionSlot();
    void uploadSlot();
    void showPredictResult(const QString&);
    void selectNameSlot();


signals:
    void startPredictSignal(const QString&);
    void insertSignal(const QStringList&);
    void selectSignal(const QString&);

private:
    QLabel* XRay_pic;
    QPushButton* BrowseButton;
    QPushButton* PredictButton;
    QPushButton* uploadData;
    QTextBrowser* ResultBrowser;
    QListWidget* personBrowser;
    QLineEdit* nameline;
    QPushButton* nameButton;
    QString XRayRoot;
    QSqlDatabase db;
    QString gailv;
    QString pic_root;
    QString predict_result;


};
